package com.dp.appi.service.impl;

import com.dp.appi.dao.ConsumerDao;
import com.dp.appi.entity.UserEntity;
import com.dp.appi.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by xiaoji on 2016/4/20.
 */
@Service
public class ConsumerServiceImpl implements ConsumerService {
    @Autowired
    private ConsumerDao consumerDao;

    /**
     * 根据账号获取用户对象
     *
     * @param userEntity 用户登录对象
     * @return
     */
    @Override
    public Map<String, Object> getUser(UserEntity userEntity) {
        return consumerDao.getUser(userEntity);
    }



    @Override
    public Map<String, Object> getUserByUsername(String username) {
        return consumerDao.getUserByUsername(username);
    }

    /**
     * @param param
     */
    @Override
    public void updateUser(Map<String, String> param) {
        consumerDao.updateUser(param);
    }

    /**
     * 根据用户获取用户组织机构
     *
     * @param userId
     * @return
     */
    @Override
    public Map<String, Object> getTSpartByUserId(String userId) {
        return consumerDao.getTSpartByUserId(userId);
    }


}
